package com.aftersale.demo.entity;

import com.aftersale.demo.utils.ValidGroup;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.List;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 
 * @TableName role
 */
@TableName(value ="role")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Role implements Serializable {
    public  Role(String s){
        this.roleName=s;
    }
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 角色名
     */
    @NotBlank(message = "角色名不能为空")
    @Size(max = 20,min = 0,message = "角色名过长")
    @ApiModelProperty(value = "角色名")
    private String roleName;

    /**
     * 角色描述
     */
    @NotBlank(message = "角色描述不能为空")
    @Size(max = 20,min = 0,message = "角色描述过长")
    @ApiModelProperty(value = "角色描述")
    private String roleDesc;

    @TableField(exist = false)
    List<Permission> rolePermission;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}